Differences From Artifact [71be745647]:
- File
src/OFObject.m
— part of check-in
[050ac82798]
at
2012-06-06 14:05:53
on branch runtime
— Merge branch 'master' into runtime
* master: (17 commits)
Slightly change the memory management API.
... (user: js, size: 19571) [annotate] [blame] [check-ins using] [more...]
To Artifact [f73166965d]:
- File
src/OFObject.m
— part of check-in
[19a677b596]
at
2012-06-11 20:50:09
on branch runtime
— Merge branch 'master' into runtime
* master: (6 commits)
Improve -[OFNumber description].
... (user: js, size: 19489) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
606 607 608 609 610 611 612 | PRE_IVAR->lastMem->next = preMem; PRE_IVAR->lastMem = preMem; return (char*)pointer + PRE_MEM_ALIGN; } | | | | | | | | 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 | PRE_IVAR->lastMem->next = preMem; PRE_IVAR->lastMem = preMem; return (char*)pointer + PRE_MEM_ALIGN; } - (void*)allocMemoryWithSize: (size_t)size count: (size_t)count { if (size == 0 || count == 0) return NULL; if (count > SIZE_MAX / size) @throw [OFOutOfRangeException exceptionWithClass: isa]; return [self allocMemoryWithSize: size * count]; } - (void*)resizeMemory: (void*)pointer size: (size_t)size { void *new; struct pre_mem *preMem; if (pointer == NULL) return [self allocMemoryWithSize: size]; |
︙ | ︙ | |||
658 659 660 661 662 663 664 | PRE_IVAR->lastMem = preMem; } return (char*)new + PRE_MEM_ALIGN; } - (void*)resizeMemory: (void*)pointer | | | | | | | | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | PRE_IVAR->lastMem = preMem; } return (char*)new + PRE_MEM_ALIGN; } - (void*)resizeMemory: (void*)pointer size: (size_t)size count: (size_t)count { if (pointer == NULL) return [self allocMemoryWithSize: size count: count]; if (size == 0 || count == 0) { [self freeMemory: pointer]; return NULL; } if (count > SIZE_MAX / size) @throw [OFOutOfRangeException exceptionWithClass: isa]; return [self resizeMemory: pointer size: size * count]; } - (void)freeMemory: (void*)pointer { if (pointer == NULL) return; |
︙ | ︙ | |||
835 836 837 838 839 840 841 | */ + (void*)allocMemoryWithSize: (size_t)size { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } | | | | | | 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | */ + (void*)allocMemoryWithSize: (size_t)size { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)allocMemoryWithSize: (size_t)size count: (size_t)count { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)resizeMemory: (void*)pointer size: (size_t)size { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)resizeMemory: (void*)pointer size: (size_t)size count: (size_t)count { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void)freeMemory: (void*)pointer |
︙ | ︙ |