Differences From Artifact [26d577e585]:
- File src/OFObject.m — part of check-in [931a8783ca] at 2012-04-03 18:30:37 on branch runtime — Make clang happy. (user: js, size: 19547) [annotate] [blame] [check-ins using]
To 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...]
︙ | ︙ | |||
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 | PRE_IVAR->lastMem->next = preMem; PRE_IVAR->lastMem = preMem; return (char*)pointer + PRE_MEM_ALIGN; } - (void*)allocMemoryWithItemSize: (size_t)itemSize count: (size_t)count { if (itemSize == 0 || count == 0) return NULL; if (count > SIZE_MAX / itemSize) @throw [OFOutOfRangeException exceptionWithClass: isa]; return [self allocMemoryWithSize: itemSize * count]; } - (void*)resizeMemory: (void*)pointer toSize: (size_t)size { void *new; struct pre_mem *preMem; |
︙ | ︙ | |||
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 itemSize: (size_t)itemSize count: (size_t)count { if (pointer == NULL) return [self allocMemoryWithItemSize: itemSize count: count]; if (itemSize == 0 || count == 0) { [self freeMemory: pointer]; return NULL; } if (count > SIZE_MAX / itemSize) @throw [OFOutOfRangeException exceptionWithClass: isa]; return [self resizeMemory: pointer toSize: itemSize * 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 865 | */ + (void*)allocMemoryWithSize: (size_t)size { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)allocMemoryWithItemSize: (size_t)itemSize count: (size_t)count { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)resizeMemory: (void*)pointer toSize: (size_t)size { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)resizeMemory: (void*)pointer itemSize: (size_t)itemSize count: (size_t)count { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void)freeMemory: (void*)pointer { |
︙ | ︙ |