上一篇简单介绍了三种Reference的使用情况,这一篇就进入源码看一下,这里以WeakReference为例。 首先来看Reference的四种状态: active即活跃状态,表明该Reference的referent未被gc,其主要特点就是next==null; pending即待处理状态,这里 ...
分类:
编程语言 时间:
2017-07-29 18:13:00
阅读次数:
150
Problem A string is simply an ordered collection of symbols selected from some alphabet and formed into a word; the length of a string is the number o ...
分类:
其他好文 时间:
2017-07-29 15:26:57
阅读次数:
206
2017-07-29 12:59:14 一、简介 1、Vector继承关系 2、Vector类扩容 Vector类的实现和ArrayList极其相似,都使用数组存储元素,但是扩容策略不一样,ArrayList基本是按照1.5倍的思路扩容,Vector是按照创建Vector对象时设置的capacity ...
分类:
编程语言 时间:
2017-07-29 15:25:29
阅读次数:
267
//reference count, copy-on-write #include #include #include #include using namespace std; class Dog { string nm; int refcount; Dog(const string& name)... ...
分类:
编程语言 时间:
2017-07-29 15:18:57
阅读次数:
254
用char*管理String类的内存,new动态分配,在析构函数中delete char*指向的new出来的内存,一个string类需要实现那些接口可参考标准库里的string: http://www.cplusplus.com/reference/string/string/ 实现思路是:在创建S ...
分类:
其他好文 时间:
2017-07-29 10:12:33
阅读次数:
187
Spring Boot 公共配置,配置 application.properties/application.yml 文件中。 摘自:http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-pr ...
分类:
编程语言 时间:
2017-07-28 18:21:47
阅读次数:
230
(下面是我参考各个网页的教程,综合起来的) 1.下载、安装 官方下载网址:http://www.sublimetext.com/3 选择适应电脑系统的版本。 比如我的是Windows,本篇文章所述的都是在Windows下安装与使用:安装时,注意勾选Add to explorer context me ...
分类:
其他好文 时间:
2017-07-28 11:06:22
阅读次数:
159
Xcode更新到7.3后会出现NSObject+MJProperty.h报Cannot create __weak reference in file using manual reference counting错误信息。 解决的办法:在Build Settings >Aplle LLVM7.1 ...
分类:
其他好文 时间:
2017-07-27 12:47:49
阅读次数:
124
原文链接 : iOS Concurrency: Getting Started with NSOperation and Dispatch Queues 原文作者 : Ghareeb Hossam 译文出自 : APPCODA 译者 : kmyhy 並行編程永遠是 iOS 開發中的重要內容。同時也是 ...
分类:
移动开发 时间:
2017-07-27 09:42:24
阅读次数:
181
Java是基于C++的,但Java是一种更纯粹的面向对象程序设计语言,和C++不同的是,Java只支持面向对象编程,因此Java的编程风格也是纯OOP风格的,即一切都是类,所有事情在类对象中完成。 在Java中,使用引用来操纵对象,在Java编程思想的第四版中,使用的术语是“引用(reference ...
分类:
编程语言 时间:
2017-07-26 23:46:14
阅读次数:
225