int64 size = PG_GETARG_INT64(0);
int64 count = PG_GETARG_INT64(1);
int64 i;
+ int64 *p;
sb_allocator *a;
a = sb_create_private_allocator();
for (i = 0; i < count; ++i)
- (void) sb_alloc(a, size, 0);
+ {
+ p = sb_alloc(a, size, 0);
+ *p = i;
+ }
+ sb_reset_allocator(a);
PG_RETURN_VOID();
}
int64 size = PG_GETARG_INT64(0);
int64 count = PG_GETARG_INT64(1);
int64 i;
+ int64 *p;
MemoryContext context;
context = AllocSetContextCreate(CurrentMemoryContext,
ALLOCSET_DEFAULT_INITSIZE,
ALLOCSET_DEFAULT_MAXSIZE);
for (i = 0; i < count; ++i)
- (void) MemoryContextAlloc(context, size);
+ {
+ p = MemoryContextAlloc(context, size);
+ *p = i;
+ }
PG_RETURN_VOID();
}