码迷,mamicode.com
首页 >  
搜索关键字:alloc    ( 3259个结果
Node buffer模块缓冲区
//1:字节 byte//1024b = 1kb [千字节]//1024kb = 1mb [兆字节]//1024mb = 1gb [吉字节]//1024gb = 1tb [梯]//1024tb = 1pb //1:创建大小为1024字节缓冲区var buf1 = Buffer.alloc(1024) ...
分类:其他好文   时间:2017-08-10 10:15:32    阅读次数:101
mxnet 源码阅读 1
mxnet/src/storage/cpu_device_storage.h 通过两个名字空间 mxnet 和 storage 定义了CPUDeviceStorage类,然后在其中定义了两个静态函数 Alloc 和 Free 负责申请CPU内存,内存是按照 alignment_=16 对齐的 用 宏 ...
分类:Web程序   时间:2017-08-08 13:58:23    阅读次数:178
mxnet 源码阅读 2
mxnet/src/storage/gpu_device_storage.h 同cpu_device_storage.h 类似通过两级命名空间 mxnet 和 storage 定义了类 GPUDeviceStorage ,内部有两个静态成员函数 Alloc 和 Free 其实现通过调用CUDA AP ...
分类:Web程序   时间:2017-08-08 13:48:43    阅读次数:237
iOS -- YYText富文本
NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString: [NSString stringWithFormat:@"%@", kRealName]]; [text setYy_color:... ...
分类:移动开发   时间:2017-08-08 11:05:39    阅读次数:513
iOS lable上的文字自适应(sizetofit)后,获得每一行的内容。返回一个包含所有行内容的数组。
// 借鉴网络资源- (void)viewDidLoad { [super viewDidLoad]; UILabel * lb = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, self.view.bounds.size.width-20, 1... ...
分类:移动开发   时间:2017-08-07 15:20:59    阅读次数:218
给键盘添加工具栏(按钮)
UIToolbar *keyboardDoneButtonView = [[UIToolbar alloc] init]; [keyboardDoneButtonView sizeToFit]; UIBarButtonItem *doneButton = [[UIBarButtonItem allo ...
分类:其他好文   时间:2017-08-07 12:01:00    阅读次数:116
制作毛玻璃效果
//加入一个图片 UIImageView *imageview = [[UIImageView alloc]init]; imageview.frame = CGRectMake(10, 100, 300, 300); imageview.contentMode = UIViewContentMod ...
分类:其他好文   时间:2017-08-05 17:54:52    阅读次数:116
10.19编写一个函数 alloc(n) 用来在内存区开辟一个连续的空间(n个字节) 。 和 free(char * p),将地址p开始的各单元释放。
#include #define NULL 0 #define ALLOCSIZE 1000 //最大存储数量 char allocbuf[ALLOCSIZE]; //定义一个存储区 char * palloc = allocbuf; //palloc总是指向存储区中第一个可用的地址 int mai... ...
分类:其他好文   时间:2017-08-04 13:44:08    阅读次数:288
UISegmentedControl 的使用
直接上代码: //UISegmentedControl 对象的创建 //參数为数组,数组为字符串数组,表示各个分段的标题。数组的对象个数确定了分段个数。 UISegmentedControl *segmentControl = [[UISegmentedControl alloc] initWith ...
分类:其他好文   时间:2017-08-02 22:15:07    阅读次数:128
19 内存分配和释放的函数
1. malloc,calloc,realloc,free属于C函数库,而new/delete则是C++函数库; 2. 多个-alloc的比较: alloc:唯一在栈上申请内存的,无需释放; malloc:在堆上申请内存,最常用; calloc:malloc+初始化为0; realloc:将原本申请 ...
分类:其他好文   时间:2017-08-01 20:52:14    阅读次数:165
3259条   上一页 1 ... 17 18 19 20 21 ... 326 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!