1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 12:20:20 +02:00

* gc.h: remove DOUBLECELL card flags.

* gc-malloc.c (scm_calloc): try to use calloc() before calling
scm_realloc().

* gc-segment.c (scm_i_initialize_heap_segment_data): remove card
init loop; handle this from scm_init_card_freelist()

* gc-card.c (scm_init_card_freelist): init bit vector here.
This commit is contained in:
Han-Wen Nienhuys 2002-08-28 23:13:30 +00:00
parent 8fa5786d7c
commit 1383773ba1
6 changed files with 53 additions and 38 deletions

View file

@ -150,7 +150,17 @@ scm_malloc (size_t sz)
void *
scm_calloc (size_t sz)
{
void * ptr = scm_realloc (NULL, sz);
void * ptr;
/*
By default, try to use calloc, as it is likely more efficient than
calling memset by hand.
*/
SCM_SYSCALL(ptr= calloc (sz, 1));
if (ptr)
return ptr;
ptr = scm_realloc (NULL, sz);
memset (ptr, 0x0, sz);
return ptr;
}