Skip to content

Commit

Permalink
fix #4072
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Mar 2, 2021
1 parent edc0552 commit 3e7770f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/memory/global_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void *GlobalMemory::alloc(uint32_t size) {
}
}

block = (MemoryBlock *) impl->pages.back() + impl->alloc_offset;
block = (MemoryBlock *) (impl->pages.back() + impl->alloc_offset);
impl->alloc_offset += alloc_size;

block->size = size;
Expand Down
14 changes: 14 additions & 0 deletions tests/swoole_table/create_10k_object.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
swoole_table: create 10,000 objects
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';
for ($i = 0; $i < 10000; $i++) {
$main = new Swoole\Table(1);
}
echo "DONE\n";
?>
--EXPECT--
DONE

0 comments on commit 3e7770f

Please sign in to comment.